'''
@Project ：python-study
@File    ：9.4直方图：电影年产量.py
@IDE     ：PyCharm
@Author  ：SUNLIN
@Date    ：2025/3/12 17:51:53
'''
import matplotlib.pyplot as plt
import numpy as np
import C8处理与分析.pandas_def as pdef

# 获取统计数据
file_path = "D:\develop\projects\Python Project\python-study\doc\datasource\C8-8.5-数据采集-clean.xlsx";
year_tj = pdef.movie_year_amount_tj(file_path)
year_tj["year"] = year_tj.index
years = year_tj["year"].dt.year
amounts = year_tj["release_date"].tolist()

# data from https://allisonhorst.github.io/palmerpenguins/

width = 0.5

fig, ax = plt.subplots()
bottom = np.zeros(3)
ax.bar(years, amounts, width, )

ax.set_ylabel("Amounts of Movie")
ax.set_title("Number of penguins with above average body mass")
ax.legend()

plt.show()

# 数据的转换 dataframe -> series -> list

# 绘制直方图
